import cv2

i=cv2.imread("966760155050624.jpg",cv2.IMREAD_UNCHANGED)

#获取像素(彩色图片)
# p = i[100,100]
# print(p)
# [168 181 203]

# 修改像素(彩色图片)
# i[100,100]=[255,255,255]
# print(i[100,100])

#修改第一个通道
# i[100,100,1]=255


#修改多个像素
i[100:150,100:150] = [255,0,0]
cv2.imshow("original",i)
cv2.waitKey(0)

cv2.destroyAllWindows()



